﻿



var me_time = null;
var over_time = null;
var state = true;
var select_state = false;

function show_message(type,msg){

 $("#lock_div").show();
 $("#lock_div").css("height",$(document).height())
 if(type.indexOf("success") >= 0 || type.indexOf("err") >= 0){
  state = false;
 }else{
  state = true;
 }

 print_message_panel(msg);

 window.setTimeout(function(){
  $("#message_panel").fadeOut();
  $("#lock_div").hide();
  state = true;
 },60000)
}

function print_message_panel(message){
 var left = $(window).width()/2 - 110;
 var top = (document.documentElement.scrollTop + document.body.scrollHeight)/2 - 30;
 $("#message_panel").css("left",left);
 $("#message_panel").css("top",top);
 $("#message_panel").fadeIn();
 $("#mess").html(message);
 if(state){
 }else{
  stop_message();
 }
}

function stop_message(){
 over_time = window.setTimeout(function(){
  $("#message_panel").fadeOut();
  $("#lock_div").hide();
  window.clearInterval(me_time);
  window.clearTimeout(over_time);
  state = true;
 },3000)
}

function message_panel_control(message){
 var left = $(window).width()/2 - 110;
 var top = document.body.scrollHeight/2 - 30;
 $("#message_panel").css("left",left);
 $("#message_panel").css("top",top);
 $("#message_panel").fadeIn();
 $("#mess").html(message);
 var count = 1;
 var use = 100;
 var me_pan_time = window.setInterval(function(){
  if(use >= 3000){
  window.clearInterval(me_pan_time);
  $("#message_panel").hide();
  }
  use += 100;
 },50);
}
function hide_select()
{
 if(isIE6())
   if(select_state == true)
   {
    $("select").hide();
    setTimeout(function(){
         $("select").show();
         },1000);
   }
   select_state = false;
}

